package com.caigou.mapper.cms;

import com.caigou.bean.cms.entity.SurveyQuestion;
import com.caigou.bean.cms.param.MoveQuestionParam;
import com.caigou.bean.cms.param.QueryFormParam;
import com.caigou.pojo.SurveyFormComponentQuestion;
import com.caigou.pojo.SurveyFormQuestionListData;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface SurveyQuestionMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(SurveyQuestion record);

    int insertSelective(SurveyQuestion record);

    SurveyQuestion selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(SurveyQuestion record);

    int updateByPrimaryKey(SurveyQuestion record);

    List<SurveyQuestion> selectByFormId(@Param("formId")String formId);

    int updateOrderForBack(MoveQuestionParam param);

    int updateOrderForFront(MoveQuestionParam param);

    int updateQuestionOrderByPrimaryKey(SurveyQuestion surveyQuestion);

    int batchUpdateQuestionOrder(SurveyQuestion surveyQuestion);

    Integer getMaxOrderByFormId(@Param("formId")String formId);

    Integer getQuestionCountByFormId(@Param("formId")String formId);

    int deleteByFormId(@Param("formId")String formId);

    List<SurveyFormQuestionListData> loadSurveyFormQuestionListData(@Param("formId") String formId);

    int updateQuestionSubmitCount(@Param("questionId") Integer questionId);

    List<SurveyFormComponentQuestion> loadSurveyFormComponentQuestion(QueryFormParam param);

    List<Integer> loadMustQuestionList(@Param("formId") String formId);
}